/**
 * @author zhounan 
 * @date 2024年6月19日
 * @version V1.0
 */
package org.zn.etl.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.zn.etl.job.context.ClusterContextManager;
import org.zn.etl.job.context.RedisClusterContextManager;
import org.zn.etl.misc.ExpressionHelper;

/**
 * @author zhounan 
 * @date 2024年6月19日
 * @version V1.0
 */
@Configuration
public class ServiceConfig {
	
	
    @Bean
    @ConditionalOnProperty(prefix = "redis" ,name = "enable" ,matchIfMissing = false ,havingValue = "true")
    ClusterContextManager clusterContextManager() {
		return new RedisClusterContextManager();
		
	}

    @Bean
    RestTemplate restTemplate(RestTemplateBuilder builder){
    
        return builder.build();
    }
	
    @Bean
	ExpressionHelper expressionHelper() {
    	return new ExpressionHelper();
	}
	
	
	
}
